//
//  RX.h
//  iMed
//
// The RX is a record of a prescription. The compound (pill) that's
// being taken is recorded as the NDCitem; then it's a matter of how 
// many and how often.
//
//  Created by Barry Press on 8/14/09.
//  Copyright 2009 Barry Press. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "NDCitem.h" 


@interface RX : NSObject <NSCoding> {
	NSDate				*written;		// When written
	NSDate				*filled;		// When filled
	NDCitem				*ndc;			// The pill
	float				dose;			// How many to take
	NSTimeInterval		interval;		// Time between doses, seconds
	float				perday;			// How many doses per day
	BOOL				bAuto;			// Eligible for auto processing
}

- (NSString*)description;
- (id)initWithDateWritten:(NSDate*)dWritten dateFilled:(NSDate*)dFilled Ndc:(NDCitem*)anNdc 
					 Dose:(float)aDose Interval:(double)anInterval;
- (id)initWithDateWritten:(NSDate*)dWritten dateFilled:(NSDate*)dFilled Ndc:(NDCitem*)anNdc 
					 Dose:(float)aDose Perday:(float)aPerday;


@property (readwrite, retain) NSDate *written;
@property (readwrite, retain) NSDate *filled;
@property (readwrite, retain) NDCitem *ndc;
@property (readwrite) float dose;
@property (readwrite) NSTimeInterval interval;
@property (readwrite) float perday;
@property (readwrite) BOOL bAuto; 

@end
